package entity;

import java.util.Arrays;
import java.util.List;

public class CakeData {
    private static List<Cake> cakes = Arrays.asList(
            new Cake(1, "巧克力蛋糕", 98.0),
            new Cake(2, "草莓慕斯", 128.0),
            new Cake(3, "提拉米苏", 88.0)
    );

    public static List<Cake> getAllCakes() {
        return cakes;
    }

    public static Cake getCakeById(int id) {
        return cakes.stream()
                .filter(c -> c.getId() == id)
                .findFirst()
                .orElse(null);
    }
}
